package com.zfl.thread.day02;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorServiceDemo02 {
    public static void main(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(3);
        for (int i = 0; i < 50; i++) {
            final int n = i;
            pool.execute(()->{
                System.out.println(Thread.currentThread().getName()+"正在执行第"+n+"个任务");
            });

        }
        pool.shutdown();
    }
}
